Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] web_widget_bokeh_chart #3076

Open
wants to merge 58 commits into
base: 18.0
Choose a base branch
from

Conversation

JasminSForgeFlow
Copy link
Contributor

Standard Migration

@ForgeFlow

LoisRForgeFlow and others added 30 commits December 19, 2024 10:51
Includes some manual fixes to silent ESLint warnings.
@JasminSForgeFlow JasminSForgeFlow marked this pull request as ready for review February 3, 2025 05:16
@ThiagoMForgeFlow
Copy link
Contributor

When debug mode is enabled, the console shows this error:

Uncaught Error: Error while loading "@web_widget_bokeh_chart/js/web_widget_bokeh_chart.esm":
Error: Invalid object: unknown key 'template', unknown key 'components', unknown key 'props', unknown key 'defaultProps'

@@ -0,0 +1,52 @@
/* global document */
import {markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
import {CharField} from "@web/views/fields/char/char_field";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add charField import and change export to:

export const bokehChartWidget = {
    ...charField,
    component: BokehChartWidget,
};

To fix the console error when debug mode is enabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, Thanks

});
super.setup();
onWillStart(() =>
loadBundle({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since 18.0 loadBundle function only permit string arguments. Try to call loadJS function for every path inside a function.

export async function loadBokehLibraries() {
    const scripts = [
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.4.1.min.js",
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.4.1.min.js",
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.4.1.min.js",
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.4.1.min.js",
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.4.1.min.js",
        "/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.4.1.min.js",
    ];

    for (const script of scripts) {
        await loadJS(script);
    }
}

And then call it inside onWillStart:
onWillStart(() => loadBokehLibraries());
By this way, the function could be called from other modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply the same logic to web_widget_bokeh_json_chart.esm.js file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@JasminSForgeFlow JasminSForgeFlow force-pushed the 18.0-mig-web_widget_bokeh_chart branch 3 times, most recently from 7720806 to 94be57c Compare February 20, 2025 12:55
@JasminSForgeFlow JasminSForgeFlow force-pushed the 18.0-mig-web_widget_bokeh_chart branch from 94be57c to 1b75d2b Compare February 21, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.